package com.bridge.file;

import cn.hutool.http.HttpUtil;

import java.io.*;

public class FileUrlUtils {

    public static void main(String[] args){

        File file = new File("E:\\warkspace\\spring-boot-demo\\spring-boot-utils\\src\\main\\resources\\txt\\url.text");
        FileInputStream fis = null;
        try {
            fis = new FileInputStream(file);
            BufferedReader br = new BufferedReader(new InputStreamReader(fis));
            br.lines().forEach(v->{
                String[] split = v.split("/");
                HttpUtil.downloadFile(v, "E:\\迅雷下载\\"+split[split.length-1]);
            });
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }finally {
            if (fis != null) {
                try {
                    fis.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }

    }
}
